In this specification the concept of short-range wireless data transmission connection refers primarily to such connections in which two or more devices that are located relatively close to each other can communicate with each other in a wireless manner. In the communication it is possible to apply for example radio communication, infrared communication, inductive communication, or the like. For example the Bluetooth™ technology, in which low-power radio transmitters and radio receivers are used, has been developed for the purpose of short-range radio communication. Such devices can communicate with each other and thereby form an ad hoc communication system. By applying short-range communication technology it is for example possible to connect peripheral devices to a computer in a wireless manner. Furthermore, for example a wireless communication device can be coupled to a portable computer, wherein from the computer it is possible to have a wireless connection to another communication network, such as the Internet data network. Thus, a situation may occur in which, the user has to enter his/her user identification and password when he/she is setting up a connection to a data network by means of the portable computer. Thus, there is a risk that it is possible to eavesdrop the user identification and password transmitted without encryption between the portable computer and a wireless communication device connected thereto with a short-range wireless connection.
Other possible implementation areas for short-range data transmission connections that can be mentioned in this context include wireless local area network (WLAN), wireless pay terminal system and wirelessly operating lock. By means of a wireless local area network it is for example in small office facilities possible to implement a local area network comprising several computers without having to conduct cabling. In a wireless pay terminal system the user can pay bills for example by means of a wireless communication device which also contains short-range communication means. Thus, a short-range data transmission connection is set up between the wireless communication device and the pay terminal for the purpose of paying bills. Correspondingly, in a wirelessly operating lock the user has a key that communicates wirelessly with the lock to ensure that the key in question is intended for controlling the function of this particular lock. Such a key may be implemented as a separate key, or it may be implemented in connection with another device, such as a wireless communication device.
In such communication systems it is problematic how the different parties in the communication can be sure that the devices in question are really authorized to the communication process. This is important especially in such situations where confidential information is transferred between different devices. For example in the aforementioned pay terminal embodiment the pay terminal has to ensure that the device used in the payment transaction really is the device used by the account holder in question or a person authorized by the account holder. Also in the lock embodiment the lock has to ensure the authenticity of the key before the lock is opened. In such embodiments, for the purpose of verifying the parties, the communication between the devices has to be protected as well as possible from outside intruders, such as eavesdroppers and intervening parties. To take these safety aspects into account, different encryption mechanisms have been developed e.g. for said Bluetooth™ systems. The techniques that are used include e.g. a key pair (PKI, Public Key Infrastructure) composed of a public key and a private key. In such an arrangement the user has a public key that he/she can send to a counterparty without encryption, and a private key which does not have to be transferred to the communication system at any stage, but the user has to keep it concealed. Thus, it is possible to transmit encrypted information to the user by encrypting the information with said public key. The user can decrypt the information with his/her private key.
One drawback of the asymmetric encryption system of the above kind is that it is relatively slow, wherein encryption of large amounts of information considerably decelerates data transmission. Communication systems also apply symmetric encryption methods in which both parties of the communication share the same private key (shared key, shared secret). A problem in this arrangement is, for example, how this private key can be transmitted to another device so that an outsider cannot find out the private key. In some cases the user himself/herself can enter this private key to different devices. In a device according to the Bluetooth™ system this private key is utilized to calculate a link key used in the radio communication, by means of which link key the actual information to be transmitted is encrypted. The maximum length determined for the link key is 128 bits, wherein the length of the private key should be at least 32 characters. It is laborious to enter such a string containing 32 characters, and there is high probability of errors, especially when the string has to be entered successively at least twice without errors before the connection can be set up.
The U.S. Pat. No. 5,241,599 discloses a method for encrypted key exchange (EKE), in which the encryption key used in the communication is first encrypted with a short encryption key, whereafter the encryption key can be transmitted in the encrypted format from one device to another via an unencrypted communication channel. In short-range systems this method can be applied in such a manner that the user enters said short encryption key to both devices, whereafter both devices transmit the encryption key of their own to the other device, encrypted with a short encryption key. Such systems have for example the drawback that the encryption efficiency is dependent for example on that how often the user changes this short encryption key. Furthermore such a short encryption key selected by the user can be guessed relatively easily, and therefore when the method is applied, it is possible that outsiders find out the short encryption key.
There is a known so-called Diffie-Hellman method, which is based on exponentiation modulo a large prime number. On the basis of this, the difficulty in breaking encryption implemented with the Diffie-Hellman method is today regarded directly proportional to the difficulty of calculating discrete logarithms modulo a large prime number. The Diffie-Hellman method is a public key based algorithm generally used especially in key exchange. The method is considered safe when keys of sufficient length and an appropriate DH generator are used. In the Diffie-Hellman method the first party determines a first key number on the basis of a first secret number and the first key number is transmitted to the second party. Correspondingly, the second party determines a second key number on the basis of a second secret number and the second key number is transmitted to the first party. Thereafter the first party generates a third key number on the basis of the first secret number and the second key number it has received, and the second party generates a fourth key number on the basis of the second secret number and the first key number it has received. The third and the fourth key numbers are identical, and they are not transmitted between the parties involved. The third and the fourth key number can thereafter be used for encryption and decryption of information to be transmitted between the parties. In this arrangement it is, however, possible that a third party is capable of changing the first key number or the second key number. This takes place for example in such a manner that a third party places itself between the first and the second party (MIM, Man In the Middle), wherein the first party mistakes the third party for the second party, and, in a corresponding manner, the second party mistakes the third party for the first party. Thus, in practise, data is transmitted between the first and the second party via the third party, and the third party detects both the messages transmitted by the first party and the messages transmitted by the second party, and is capable of modifying them. The Diffie-Hellman method is described in more detail in the U.S. Pat. No. 4,200,770 to which reference is made in this context.
An improvement has been suggested for the Diffie-Hellman method, by means of which different parties in a short-range wireless communication method can be verified. The method is disclosed in the publication F. Stajano, R. Anderson, The Resurrecting Duckling: Security Issues for Ad-Hoc Wireless Networks, 1999 AT&T Software Symposium. The method disclosed in this publication is based on the fact that both parties check that the third and the fourth encryption numbers obtained as a result of the actions described above are identical. This can be conducted for example in such a manner that the calculated encryption numbers are displayed in the devices of both parties and the users of the devices compare these numbers with each other. However, to attain a sufficiently strong encryption (an encryption key of at least 128 bits) the encryption numbers have to be strings composed of at least 32 characters. It is difficult to compare such strings which are relatively long, and the error probability is high.